package ups.Schedule;
import ups.Schedule.ScheduleItem;
import java.util.Comparator;

public class ScheduleItemComparator implements Comparator<ScheduleItem> {
	public int compare( ScheduleItem i1, ScheduleItem i2 ) {
		ScheduleTime t1 = i1.getTime();
		ScheduleTime t2 = i2.getTime();
		
		if( t1.getHours() > t2.getHours() ) {
			return 1;
		} else if( t1.getHours() < t2.getHours() ) {
			return -1;
		} else {
			if( t1.getMinutes() > t2.getMinutes() ) {
				return 1;
			} else if( t1.getMinutes() < t2.getMinutes()) {
				return -1;
			} else {
				return 0;
			}
		}
		
		
	}
}
